package playlist;

import java.util.HashMap;
import java.util.Map;

public class PlaylistType {

	private String name;
	private String start;
	private String currentType = null;
	private Map<String, String[]> transitions;
	
	public PlaylistType(String aName, String aStart) {
		name = aName;
		start = aStart;
		currentType = start;
		transitions = new HashMap<String, String[]>();
	}
	
	public String getName() {
		return name;
	}
	
	public String getStart() {
		return start;
	}
	
	public String getNewTransition() {
		String[] types = transitions.get(currentType);
		int indix = (int) Math.floor(Math.random()
			* types.length);
		currentType = types[indix];
		return currentType;
	}
	
	public void addTransition(String start,
		String [] transitions) {
		this.transitions.put(start, transitions);
	}
}
